package com.shell.provider;

import com.shell.governor.user.po.PubUserExtra;
import com.shell.governor.user.service.PubUserExtraService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PubUserExtraProvider {
	@Autowired
	private PubUserExtraService pubUserExtraService;

	@RequestMapping({ "/userExtra/save" })
	void save(@RequestBody PubUserExtra userExtra) {
		this.pubUserExtraService.save(userExtra);
	}

	@RequestMapping({ "/userExtra/getInviteCode" })
	String getInviteCode(@RequestParam("userId") String userId, @RequestParam("entId") String entId) {
		return this.pubUserExtraService.getInviteCode(userId, entId);
	}

	@RequestMapping({ "/userExtra/selectOne" })
	PubUserExtra selectOne(@RequestBody PubUserExtra userExtra) {
		return (PubUserExtra) this.pubUserExtraService.selectOne(userExtra);
	}

	@RequestMapping({ "/userExtra/updateUserStateForEnt" })
	void updateUserStateForEnt(@RequestParam("entId") String entId, @RequestParam("userState") String userState) {
		this.pubUserExtraService.updateUserStateForEnt(entId, userState);
	}
}
